#include <iostream>
int main()
{
    //创建两个数组
    int years[3] = {2020, 2021, 2022};
    double wages[4] = {100.111, 200.222, 300.333, 400.444};
    //1. 使用两种方法获取数组的地址
    using namespace std;
    int *year_p = years;
    year_p = year_p + 1;
    cout << "The address of second years by address notation =" << year_p << " the content=" << *year_p << endl;
    cout << "The address of second year by square bracket" << &years[1] << endl; 
    //2. 使用两种方法获取数组的第三个元素
    
    double *wagep = wages;
    wagep = wagep + 2;
    cout << "The third item of the wages is " << *wagep << endl;

    //3. 对比size of的值
    cout << "Size of wages = " << sizeof(wages) << endl;
    cout << "Size of wagep = " << sizeof(wagep) << endl;
    /*
     OutPut:
        The address of second years by address notation =0x7ffee621e3d0 the content=2021
        The address of second year by square bracket0x7ffee621e3d0
        The third item of the wages is 300.333
        Size of wages = 32
        Size of wagep = 8
    */
    return 0;
}
